package com.woniuxy.commons.service.warehouse.factory;

import com.woniuxy.commons.entity.warehouse.IoWarehouseProduct;
import com.woniuxy.commons.result.Result;
import com.woniuxy.commons.service.warehouse.WareHouseService;
import feign.hystrix.FallbackFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author:SHEAndme
 * @Todo:TODO
 * @DateTime:2022/4/28 17:36
 * @Component:霍格沃兹魔法学院
 **/
@Component
public class WareHouseServiceFactory implements FallbackFactory<WareHouseService> {
    @Override
    public WareHouseService create(Throwable throwable) {
        return new WareHouseService() {
            @Override
            public Result batchAdd(List<IoWarehouseProduct> ioWarehouseProducts) {
                return Result.fail().message("请稍后重试");
            }
        };
    }
}
